//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;

namespace OpenLS.Drawing.UI
{
    class Pair<T1, T2>
    {
        public Pair()
        {

        }
        public override int GetHashCode()
        {
            int result = 0;
            if (first != null)
                result += first.GetHashCode();
            if (second != null)
                result += second.GetHashCode();
            return result;
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
                return true;
            Pair<T1, T2> p2 = obj as Pair<T1, T2>;
            if (p2 != null)
                return Equals(p2);
            return false;
        }

        private bool Equals(Pair<T1, T2> p2)
        {
            return object.Equals(First, p2.First) && object.Equals(Second, p2.Second);
        }
        public Pair(T1 first, T2 second)
        {
            this.first = first;
            this.second = second;
        }
        private T1 first;

        public T1 First
        {
            get { return first; }
            set { first = value; }
        }
        private T2 second;

        public T2 Second
        {
            get { return second; }
            set { second = value; }
        }


    }
}
